package com.itcast.demo;

import com.itcast.demo.service.OrderService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
      /*  ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");*/
 
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(config.class);
 
        System.out.println(applicationContext.getBean("userService"));
        System.out.println(applicationContext.getBean(OrderService.class));
        OrderService bean = applicationContext.getBean(OrderService.class);
        bean.test();
        System.out.println(bean);
    }
}